﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DAL
{
    public class DALCategorias : DALBase
    {
        private static string cmdCategoriaPorId = "Select * From Categorias Where CatId = @CatId ";
        private static string cmdCategorias = "Select * From Categorias";

        public SqlDataReader BuscarCategoriaPorId(int categoriaId)
        {
            List<SqlParameter> lstparameters = new List<SqlParameter>();
            lstparameters.Add(new SqlParameter("@CatId", categoriaId));
            SqlDataReader dr = select(lstparameters, cmdCategoriaPorId, CommandType.Text);

            return dr;
        }

        public SqlDataReader BuscarCategorias() {
            List<SqlParameter> lstparameters = new List<SqlParameter>();

            SqlDataReader dr = select(lstparameters, cmdCategorias, CommandType.Text);

            return dr;
            
        }
    }
}
